home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
_TALKMOD.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
2KB
|
74 lines
FUNCTION _TalkMode && Set and Query TALK Setting
PARAMETER p__action
*--------------------------------------------------------------------
* NAME
* _TalkMode - Set and query TALK Setting
*
* SYNOPSIS
* _TalkMode( p__action )
*
* DESCRIPTION
* TalkMode() sets the TALK mode ON or OFF
* based on pp_action. The function returns a
* logical value representing the SET TALK mode prior
* to execution of the function. If a non-logical
* value is used for pp_action, _TALKMODE() will
* return the current state of SET TALK ON or OFF
* without changing it.
*
* PARAMETER(S)
* p__action - If a logical value, .T. will SET TALK
* ON and .F. will SET TALK OFF. The prior setting
* will be returned as a logical value. An argument
* of any other data type will merely cause the
* current SET TALK setting to be returned.
*
* EXAMPLE
*
* * Here _TALKMODE() is used to set TALK ON, and
* * then restore the original TALK setting:
*
* * Set talk mode off:
* oldmode = _TALKMODE(.T.)
* ... more code here ...
* * Return TALK to original setting:
* oldmode = _TALKMODE(oldmode)
*
* * If you want to restore the talk mode in
* * a program and you don't need the previous
* * result, try the following:
* IF _TALKMODE( oldmode )
* ENDIF
*
* * This toggles TALK mode to the opposite value:
* mdummy = _TALKMODE( .NOT. _TALKMODE(0) )
*
* SEE ALSO:
* SET TALK, SET("TALK")
*
*--------------------------------------------------------------------
PRIVATE ll_oldmode
IF SET("TALK") = "ON"
SET TALK OFF
ll_oldmode = .T.
SET TALK ON
ELSE
ll_oldmode = .F.
ENDIF
IF TYPE( "p__action" ) = "L"
IF p__action
SET TALK ON
ELSE
SET TALK OFF
ENDIF
ENDIF
RETURN( ll_oldmode )
*-- END: _TalkMode( p__action )